﻿#region using statements

using Microsoft.Xna.Framework.Input;

#endregion

namespace XNAGameEngine.Input
{
    /// <summary>
    /// Interface that allows objects to receive Gamepad input events
    /// </summary>
    public interface IInputListener
    {
        #region local methods

        /// <summary>
        /// Called by the individual input managers to throw events for buttons pressed. Two of the first
        /// three parameters will be null. Position will not be null whenever an input that requires a 
        /// value change is detected. (thumbstick changes and mouse movement are some examples. Triggers 
        /// only use a single float value and this will be passed in as the first parameter of position.
        /// </summary>
        /// <param name="input">a struct containing the input detected</param>
        void InputPressed(InputMessage input);

        /// <summary>
        /// Called by the individual input managers to throw events for buttons released. Two of the first
        /// three parameters will be null. Position will not be null whenever an input that requires a 
        /// value change is detected. (thumbstick changes and mouse movement are some examples. Triggers 
        /// only use a single float value and this will be passed in as the first parameter of position.
        /// </summary>
        /// <param name="input">a struct containing the input detected</param>
        void InputReleased(InputMessage input);

        /// <summary>
        /// Called by the individual input managers to throw events for buttons held. Two of the first
        /// three parameters will be null. Position will not be null whenever an input that requires a 
        /// value change is detected. (thumbstick changes and mouse movement are some examples. Triggers 
        /// only use a single float value and this will be passed in as the first parameter of position.
        /// </summary>
        /// <param name="input">a struct containing the input detected</param>
        void InputHeld(InputMessage input);

        /// <summary>
        /// Event should be thrown before the object is destroyed to unregister it as a listener, otherwise
        /// the object will continue to stay in memory and receive input events after it is no longer needed
        /// </summary>
        event ManagerInput.InputRegisterListenerEventHandler
            ThrowUnregisterListenerEvent;

        #endregion
    }
}